package com.fujin.gulimall.cart.vo;

import java.math.BigDecimal;
import java.util.List;

/**
 * @title: CartItemVo
 * @Author uIn
 * @Date: 2022/3/13 11:02
 * @Version 1.0
 * 购物车的每一个购物项Vo
 * 因为get方法需要计算，所以不使用@Data
 */
public class CartItemVo {

    private Long skuId;

    /**
     * 是否选中
     */
    private Boolean check = true;

    private String title;

    private String image;

     /**
     * 商品套餐属性
     */
    private List<String> skuAttrValues;

    /**
     * 商品单价
     */
    private BigDecimal price;

    /**
     * 购买总数
     */
    private Integer count;

    /**
     * 总价格，一个商品可能买多个
     */
    private BigDecimal totalPrice;

    /**
     * 总价格需要计算
     * @return
     */
    public BigDecimal getTotalPrice() {
        //总价格需要商品单价 * 购物的总数
        this.price.multiply(new BigDecimal(""+this.count));
        return totalPrice;
    }

    public Long getSkuId() {
        return skuId;
    }

    public void setSkuId(Long skuId) {
        this.skuId = skuId;
    }

    public Boolean getCheck() {
        return check;
    }

    public void setCheck(Boolean check) {
        this.check = check;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public List<String> getSkuAttrValues() {
        return skuAttrValues;
    }

    public void setSkuAttrValues(List<String> skuAttrValues) {
        this.skuAttrValues = skuAttrValues;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }
}
